package com.foruo.learn.designmode.composite;

public class TestMe {

    public static void main(String[] args){
        Organization organization = new Organization("1","总司令处");

        Organization organization1 = new Organization("2","一军军长处");
        Organization organization2 = new Organization("3","二军军长处");

        Organization organization11 = new Organization("4","一军一旅旅长处");
        Organization organization12 = new Organization("5","一军二旅旅长处");

        organization.add(organization1);
        organization.add(organization2);

        organization1.add(organization11);
        organization1.add(organization12);

        //打印所有
        System.out.println(organization);
        for(Organization o :organization.getOrganizationList()){
            System.out.println(o);
            for(Organization oo :o.getOrganizationList()){
                System.out.println(oo);
            }
        }

    }

}
